Conditionalize units which require a boot disk#102
Conditionalize units which require a boot disk#102bgilbert merged 3 commits intocoreos:masterfrom bgilbert:live
Conversation
|
Updated to fix |
dustymabe
left a comment
There was a problem hiding this comment.
initial comments. will add some more tomorrow after testing artifacts
|
|
||
| # Make sure if any ExecStart= fail, the boot fails. This normally would | ||
| # already be guaranteed by `initrd.target` failing, but that doesn't seem to be | ||
| # enough: https://bugzilla.redhat.com/show_bug.cgi?id=1696796 |
There was a problem hiding this comment.
I tried dropping the stanza from ignition-complete.target, and that causes systemd to loop in the initrd if ignition-files fails. With the stanza, it properly fails the boot. So, still needed.
On the other hand, if a dependency of ignition-diskful.target fails, systemd doesn't fail the boot with or without this stanza. 🙁
There was a problem hiding this comment.
Yeah, I recalled this working on f30. I guess systemd might've regressed on git master too? If that's the case, we should be able to file an issue upstream for this where it'll hopefully get more exposure. (The only reason I made it an RHBZ was that upstream only wants bugs that reproduce against N and N-1).
There was a problem hiding this comment.
would definitely be nice if we could get this fixed in at least f31
| @@ -0,0 +1,16 @@ | |||
| # This target contains Ignition units that should only run when we have | |||
There was a problem hiding this comment.
i've been trying to think of a better name than ignition-diskful.target but I haven't come up with any clear winners. ignition-withbootdisk.target was an initial thought but meh..
There was a problem hiding this comment.
diskful being the opposite of diskless 🙂
There was a problem hiding this comment.
Maybe something like ignition-bootloader.target, diskful doesn't quite convey the entire context that it's specifically for units targeting the boot disk.
I'd also be fine leaving it as is given the comments in the target.
There was a problem hiding this comment.
I agree that it doesn't. Those units aren't really related to the bootloader, though.
There was a problem hiding this comment.
others possibles: ignition-withharddisk.target ignition-bootedfromdisk.target blah blah blah :)
diskfulbeing the opposite ofdisklessslightly_smiling_face
You know this might sound dumb, but putting that exact word in the description of this target unit file might actually help it click for people.
i.e. when we're not running diskless from a live image out of RAM
There was a problem hiding this comment.
You know this might sound dumb, but putting that exact word in the description of this target unit file might actually help it click for people.
Good point. Updated.
| @@ -0,0 +1,16 @@ | |||
| # This target contains Ignition units that should only run when we have | |||
There was a problem hiding this comment.
Maybe something like ignition-bootloader.target, diskful doesn't quite convey the entire context that it's specifically for units targeting the boot disk.
I'd also be fine leaving it as is given the comments in the target.
Add ignition-diskful.target, containing units that expect a writable boot disk. Enable it from the generator unless there's a command "is-live-image" which returns 0.
In live boots there's no /boot partition with a flag file to remove.
dustymabe
left a comment
There was a problem hiding this comment.
LGTM - I've written down this item as a followup:
- investigate need for https://bugzilla.redhat.com/show_bug.cgi?id=1696796 in ignition-diskful.target and ignition-complete.target - report issue upstream if not really fixed
| install_ignition_unit ignition-files.service | ||
| install_ignition_unit ignition-remount-sysroot.service | ||
|
|
||
| # units only started when we have a boot disk |
There was a problem hiding this comment.
Wonder if it'd be cleaner to have the units test ConditionPathExists=!/run/ostree-live instead? I don't have a strong opinion though.
There was a problem hiding this comment.
All of these except ignition-remount-sysroot.service pull in device dependencies, so they have to be enabled via generator. Conditions are only evaluated after dependencies are pulled in.
On live PXE or ISO boots, skip units which operate on a boot disk.
Part of coreos/fedora-coreos-config#155.